package list;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * created by flyketch
 * 19-10-11 上午9:27
 */
public class TestList {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
//        list = Arrays.asList("hello", "china", "ss");

        list.add("a");
        list.add("b");
        list.remove(0);
//        List<String> info = list;
        System.out.println(list);

        List<String> person=new ArrayList<>();
        person.add("jackie");   //索引为0  //.add(e)
        person.add("peter");    //索引为1
        person.add("annie");    //索引为2
        person.add("martin");   //索引为3
        person.add("marry");    //索引为4

        person.remove(3);   //.remove(index)
        person.remove("marry");

        person.forEach(val -> {
            System.out.println("hello");
            System.out.println(val);
            System.out.println("world");
        });

        list.clear();
        System.out.println(list);
    }
}